import request from "/@/utils/request"

export function office(query?: Object) {
  return request({
    url: '/admin/param/publicValue/OFFICE_ONLINE',
    method: 'get',
    params: query
  })
}
export function officeType(query?: Object) {
  return request({
    url: '/admin/param/publicValue/OFFICE_TYPE',
    method: 'get',
    params: query
  })
}
export function officeView(query?: Object) {
  return request({
    url: '/admin/param/publicValue/OFFICE_VIEW',
    method: 'get',
    params: query
  })
}
export function keypointsList(id?: string) {
  return request({
    url: '/train/jnglKeyPoints/queryKeyPointListByZymcId/' + id,
    method: 'get'
  })
}
export function getAddList(query?: Object) {
  return request({
    url: '/train/kszlFile/getAddList?'+query,
    method: 'get'
  })
}
//新增关键点
export function saveProfession(obj?: Object) {
  return request({
    url: '/train/jnglKeyPoints/saveProfession',
    method: 'post',
    data: obj
  })
}
//保存上传资料
export function fileSubmit(obj?: Object) {
  return request({
    url: '/train/kszlFile/saveOrEdit',
    method: 'post',
    data: obj
  })
}
//上传文件
export function uploadSysFile(obj?: Object) {
  return request({
    url: '/admin/sys-file/upload',
    method: 'post',
    data: obj
  })
}
//上传文件回显数据
export function uploadSysFileData(obj?: Object) {
  return request({
    url: '/train/kszlFile/addFileList',
    method: 'post',
    data: obj
  })
}
export function fetchList(query?: Object) {
  return request({
    // url: '/train/kszlFile/page',
    url: '/train/kszlFile/getEditList',
    method: 'get',
    params: query
  })
}

export function addObj(obj?: Object) {
  return request({
    url: '/train/kszlFile',
    method: 'post',
    data: obj
  })
}

export function getObj(id?: string) {
  return request({
    url: '/train/kszlFile/' + id,
    method: 'get'
  })
}

export function delObjs(ids?: Object) {
  return request({
    url: '/train/kszlFile',
    method: 'delete',
    data: ids
  })
}

export function putObj(obj?: Object) {
  return request({
    url: '/train/kszlFile',
    method: 'put',
    data: obj
  })
}
export function updateOnlyOffice(obj?: Object) {
  return request({
    url: '/train/kszlFile/updateOnlyOffice',
    method: 'put',
    data: obj
  })
}
export function fetchList1(query?: Object) {
  return request({
    url: '/train/kszlFile/getEditList?' + query,
    method: 'get',
  })
}
